package com.example.routeplansystem.entity.dto;

import com.alibaba.fastjson.JSON;
import com.example.routeplansystem.entity.po.NodePojo;
import com.example.routeplansystem.entity.po.Solution;
import com.example.routeplansystem.entity.po.VehicleMessage;
import com.example.routeplansystem.entity.vo.VehicleTemp;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @Author lucong
 * @Date 2022/4/15
 * @Description
 */

@Data
@NoArgsConstructor
public class Route {
    private List<NodePojo> route;
    private VehicleMessage vehicle;

    public Route(Solution solution, VehicleMessage vehicle) {
        List<NodePojo> nodePojos = JSON.parseArray(solution.getRoute(), NodePojo.class);
        this.route = nodePojos;
        this.vehicle = vehicle;
    }
}
